package com.cheifsteam.springframework.context.support;

import com.cheifsteam.springframework.beans.factory.BeanFactory;
import com.cheifsteam.springframework.context.AbstractApplicationEventMulticaster;
import com.cheifsteam.springframework.context.ApplicationEvent;
import com.cheifsteam.springframework.context.ApplicationListener;

/**
 * @author 屈燃希
 * @date 2025/2/18 17:29
 * @content
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {
    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {
        setBeanFactory(beanFactory);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void multicastEvent(final ApplicationEvent event) {
        for (final ApplicationListener listener : getApplicationListeners(event)) {
            listener.onApplicationEvent(event);
        }
    }
}
